# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gnome-calculator
pkgver=3.25.92+11+g1e9e84b0
pkgrel=1
pkgdesc="GNOME Scientific calculator"
url="https://wiki.gnome.org/Apps/Calculator"
arch=(i686 x86_64)
license=(GPL)
depends=(gtk3 dconf gtksourceview3 mpfr libsoup libmpc)
makedepends=(intltool yelp-tools vala git appstream-glib)
groups=(gnome)
options=(!emptydirs)
_commit=1e9e84b034aca26a88ceb3d942d8324a40c4efd0  # master
source=("git+https://git.gnome.org/browse/gnome-calculator#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --disable-schemas-compile \
      --localstatedir=/var --libexecdir=/usr/lib/gnome-calculator
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd $pkgname
  make DESTDIR="${pkgdir}" install
}
